package org.bud.excel.expot.fmt;

import org.bud.data.bit.fmt.DoubleFmt;
import org.bud.data.bit.fmt.IntFmt;

import java.math.BigDecimal;
import java.util.Optional;
import java.util.function.Function;

/**
 * @author shaun
 * @date 2024/7/21
 * @instruction
 */
public class ExcelIntFmt extends IntFmt implements ExcelFormat {
    @Override
    public Function<BigDecimal, ?> fain() {
        return b -> Optional.ofNullable(b).map(o -> o.doubleValue()).orElse(null);
    }


    @Override
    public String format() {
        return "0";
    }
}
